# Contributor: Jules Maselbas <jmaselbas@zdiv.net>
# Maintainer: Jules Maselbas <jmaselbas@zdiv.net>
pkgname=wch-isp
pkgver=0.4.1
pkgrel=2
pkgdesc="Firmware programmer for WCH microcontrollers over USB"
url="https://sr.ht/~jmaselbas/wch-isp"
arch="all"
license="GPL-2.0-only"
makedepends="libusb-dev pkgconf"
subpackages="$pkgname-doc $pkgname-udev-rules:udev_rules:noarch"
options="!check" # no tests
source="https://pub.zdiv.net/dist/wch-isp-$pkgver.tar.gz"

build() {
	make all
}

package() {
	make DESTDIR="$pkgdir" PREFIX=/usr UDEVPREFIX=/usr/lib/udev install install-rules
}

udev_rules() {
	pkgdesc="udev rules for $pkgname"
	amove usr/lib/udev/rules.d/50-wchisp.rules
}

sha512sums="
a2cd8806a7e5d02eae7641279e68f4b6d130c86476e8c3259199b294815c00208059f43060aa8b93eeafaf9adbd9ef71e7e3b4f39389104813f95c87fd86e9ad wch-isp-0.4.1.tar.gz
"
